<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head th:replace="dashboard/header :: header"></head>
<body>
	<div layout:fragment="content">
		
		<div class="container-fluid">
            <div class="row">
                 <div class="col-lg-12">
              		 <div class="btn-group-sm" id="toolbar-type" role="group">
			            <a class="btn btn-warning" onclick="$.table.exportExcel()">
							<i class="fa fa-download"></i> 导出
						</a>
					</div>
					<div class="col-sm-12 select-table table-striped">
						<table id="bootstrap-table-type" data-mobile-responsive="true"></table>
					</div>
					
                </div>
            </div>
        </div>
		
	</div>

	<footer th:replace="dashboard/footer :: footer"></footer>
	
	 <script>
		var detailFlag = "";
		var prefix = ctx + "monitor/operlog";
		var tableType ; 

		$(function() {
		    var typeOptions = {
		    	id: "bootstrap-table-type",
		    	url: ctx+"portal/ucenter/dictionaryType/datatables" ,
			    createUrl: ctx + 'portal/ucenter/dictionaryType/add' ,
			    updateUrl: ctx+"portal/ucenter/dictionaryType/modify?id={id}" ,
			    detailUrl: ctx+"portal/ucenter/dictionaryType/detail?id={id}",
			    removeUrl: ctx+"portal/ucenter/dictionaryType/delete" ,
			    statusUrl: ctx+"portal/ucenter/dictionaryType/changeStatus?id={id}" , 
		        exportUrl: ctx + "portal/ucenter/dictionaryType/exportExcel",
		        sortName: "operTime",
		        toolbar: "toolbar-type" ,
		        uniqueId:"id" ,
		        rowEditor: true ,
		        sortOrder: "desc",
		        modalName: "字典分类",
		        escape: true,
		        showPageGo: true,
		        rememberSelected: true,
		        columns: [{field: 'state',checkbox: true },
		        	 
			        {field: 'applicationIdLabel', width:'150px' , title: '所属应用'},
			        {field: 'codeTypeName', title: '代码类型'},
			        {field: 'codeTypeValue', title: '代码值'} ,
			        {field: 'id' , title: '操作',  align: 'center', width:'120px',  formatter: function(value, row, index) {
			                var actions = [];
			                actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="operateEdit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
			                actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="far fa-trash-alt"></i>删除</a> ');

			                return actions.join('');
			          }
			     }]
		    };
		    $.table.init(typeOptions);
		});
		
		function operateEdit(id){
		    var url =  ctx+"portal/ucenter/dictionaryType/modify?id="+id ;
			$.modal.open("编辑字典分类", url , '600' , '400' , null);
		}	
		
	</script>

</body>
</html>
